import request from '@/config/axios'

export type ProjectMaterialVO = {
  productName: string,
  imgUrl: string,
  unit: string,
  remark: string,
  other: string,
}

export const getProjectMaterialPage = (params: PageParam): Promise<{
  total: number,
  list: ProjectMaterialVO[]
}> => request.get({
  url: '/business/project/material/page',
  params
})
export const getProjectMaterial = (id: number): Promise<ProjectMaterialVO> => request.get({
  url: `/business/project/material/${id}`
})

export const delProjectMaterialList = (ids: number[]): Promise<ProjectMaterialVO> => request.get({
  url: `/business/project/material/delete`,
  params: {ids: ids.join(',')}
})
export const createProjectMaterial = (data: ProjectMaterialVO) => request.post({
  url: `/business/project/material/create`,
  data
})
export const updateProjectMaterial = (data: ProjectMaterialVO) => request.post({
  url: `/business/project/material/update`,
  data
})

